<?php

namespace Admin\Controller;
use Think\Controller;
class LogController extends BaseController
{
    /*
     * 获取列表
     */
    public function index()
    {
        if (IS_POST) {

            $tea = M('Log');
            if (!isset($_POST['page']) || empty($_POST['page'])) {
                $page = 1;
            } else {
                $page = $_POST['page'];
            }
            if (!isset($_POST['limit']) || empty($_POST['limit'])) {
                $limit = 10;
            } else {
                $limit = $_POST['limit'];
            }
            


            $count = $tea->where($condition)->count();
            $data = $tea->where($condition)->order('log_id desc')->page($page, $limit)->select() ?: [];
            

            return $this->successResponse('获取成功', $data, $count);
        } else {
            $this->display();
        }
    }
}

